var pathTempFile=WScript.Arguments(0)
var arguments=WScript.Arguments(1)
//Replace / with " because WScript would have removed the double quotes.
arguments=arguments.replace(/\//g,'\"')
WindowVisible = 0
//WScript.Echo('cmd /C WHERE '+arguments+' > \"'+pathTempFile+'\"')//Test
//WScript.CreateObject("WScript.Shell").Run('cmd /C WHERE '+arguments+' > \"'+pathTempFile+'\"',WindowVisible)
//WScript.Echo('cmd /C DIR /b \"'+arguments+'\" > \"'+pathTempFile+'\"')//Test
WScript.CreateObject("WScript.Shell").Run('cmd /C DIR /b \"'+arguments+'\" > \"'+pathTempFile+'\"',WindowVisible)